home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 February / PCWorld_2000-02_cd.bin / Software / Servis / FFE / SOUND.SWG / 0042_VOC Format.pas < prev    next >
Pascal/Delphi Source File  |  1997-05-11  |  5KB  |  121 lines

  1. I have figured out most of the .VOC format, and here it is:
  2. =============================================================
  3.  
  4.  
  5. HEADER: (bytes 00-19)
  6. =======
  7.      byte #           Description
  8.      ------           -----------
  9.      00-12            Creative Voice File
  10.      13               1A (eof to abort printing of file)
  11.      14-15            1A 00  word offset in file of first data block
  12.      16-17            Version number             (VOC-HDR puts 0A 01)
  13.      18-19            2's Comp of Ver. # + 1234h (VOC-HDR puts 29 11)
  14.  
  15. DATA: (bytes 1A+)    A series of data blocks terminated by 00
  16. =====
  17.  
  18.    Data Block:  TYPE(1-byte), SIZE(3-bytes), INFO(0+ bytes)
  19.    -----------
  20.  
  21.       TYPE   Description   Size (3-byte int)   info
  22.       ----   -----------   -----------------   ----
  23.       01     Sound data    2+length of data    *
  24.       02     ????
  25.       03     Silence       3                   *
  26.       04     Marker        2                   marker #
  27.       05     ????
  28.       06     Repeat        2                   # of repetitions
  29.       07     End repeat    0
  30.       08+    ????
  31.  
  32. *Sound info format:         *Silence info format:
  33.  -----------------           --------------------
  34.  00   Sample rate            00-01  Length of silence (weird encryption)
  35.  01   Compression type       02     38
  36.  02+  Data
  37.  
  38.  
  39. Sample rate       -- SR byte = 256-(1000000/sample_rate)
  40. Length of silence -- (# of .1 seconds encrypted)
  41. Compression type  -- 8-bits    = 0
  42.                      4-bits    = 1
  43.                      2.5-bits  = 2
  44.                      2-bits    = 3
  45.                      Multi DAC = 3+(# of channels)
  46.  
  47. Silence encoding in VOXKIT finds quiet places in file, and creates a separate
  48. block that is of type Silence.
  49.  
  50.  
  51.  
  52. The only remaining mysteries are what types 2&5&8+ are if they exist, and the
  53. exact conversion of the silence length integer to seconds.  If you have any
  54. more information, please email me at:   galt@dsd.es.com
  55. I hope this info will help to create more  public domain utilities for the
  56. soundblaster.
  57.            Greg
  58.  
  59.  
  60. I just got the developer's kit for the SoundBlaster so I can fill
  61. in some holes in the CMF File Format.   - John
  62.  
  63. -----------------------------------------------------------------
  64.  
  65. Creative Voice File (VOC) Format:
  66.  
  67.     HEADER (bytes 00-19)
  68.     Series of DATA BLOCKS (bytes 1A+) [Must end w/ Terminator Block]
  69.  
  70. -----------------------------------------------------------------
  71.  
  72. HEADER:
  73. =======
  74.      byte #     Description
  75.      ------     ------------------------------------------
  76.      00-12      Creative Voice File
  77.      13-15      1A 1A 00  (eof to abort printing of file)
  78.      16-17      Version number (minor,major) (VOC-HDR puts 0A 01)
  79.      18-19      2's Comp of Ver. # + 1234h (VOC-HDR puts 29 11)
  80.  
  81. -----------------------------------------------------------------
  82.  
  83. DATA BLOCK:
  84. ===========
  85.  
  86.    Data Block:  TYPE(1-byte), SIZE(3-bytes), INFO(0+ bytes)
  87.    NOTE: Terminator Block is an exception -- it has only the TYPE byte.
  88.  
  89.       TYPE   Description     Size (3-byte int)   Info
  90.       ----   -----------     -----------------   -----------------------
  91.       00     Terminator      (NONE)              (NONE)
  92.       01     Sound data      2+length of data    *
  93.       02     Sound continue  length of data      Voice Data
  94.       03     Silence         3                   **
  95.       04     Marker          2                   Marker# (2 bytes)
  96.       05     ASCII           length of string    null terminated string
  97.       06     Repeat          2                   Count# (2 bytes)
  98.       07     End repeat      0                   (NONE)
  99.  
  100.       *Sound Info Format:       **Silence Info Format:
  101.        ---------------------      ----------------------------
  102.        00   Sample Rate           00-01  Length of silence - 1
  103.        01   Compression Type      02     Sample Rate
  104.        02+  Voice Data
  105.  
  106.  
  107.   Marker#           -- Driver keeps the most recent marker in a status byte
  108.   Count#            -- Number of repetitions + 1
  109.                          Count# may be 1 to FFFE for 0 - FFFD repetitions
  110.                          or FFFF for endless repetitions
  111.   Sample Rate       -- SR byte = 256-(1000000/sample_rate)
  112.   Length of silence -- in units of sampling cycle
  113.   Compression Type  -- of voice data
  114.                          8-bits    = 0
  115.                          4-bits    = 1
  116.                          2.6-bits  = 2
  117.                          2-bits    = 3
  118.                          Multi DAC = 3+(# of channels) [interesting--
  119.                                        this isn't in the developer's manual]
  120.  
  121.